export function setUser(value) {
  if (value) {
    value = typeof value !== 'string' ? JSON.stringify(value) : value
  }
  localStorage.setItem('user', value)
}

export function getUser() {
  let data = localStorage.getItem('user')
  let type = localStorage.getItem('type')

  if (data) {
    data = JSON.parse(data)
  }else{
    return {};
  }
  data.type= type;
  return data
}